package net.wanho.controller;

import com.github.pagehelper.PageInfo;
import lombok.RequiredArgsConstructor;
import net.wanho.entity.User;
import net.wanho.service.UserService;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * Author：汤小洋
 * Date：2023-09-26 16:01
 * Description：<描述>
 */
@RestController
@RequestMapping("/user")
@RequiredArgsConstructor
public class UserController {

    private final UserService userService;

    @PostMapping("/register")
    public String register(@RequestBody User user) {
        userService.register(user);
        return "success";
    }

    @GetMapping("/findAll")
    public List<User> findAll(){

        return null;
    }

    @GetMapping("/findById")
    public User findById(Integer id){

        return null;
    }

    @GetMapping("/findByPage")
    public PageInfo<User> findByPage(Integer page, Integer size){

        return null;
    }

}
